package cn.gmy.day0721_JavaIO;

import java.io.*;

public class TestIO {
	
	public static void main(String[] args) throws Exception {
		
		//�ֽ�������
		FileInputStream fis = new FileInputStream("D:/aaa.txt");
		
		//�����ֽ�������
		BufferedInputStream bis = new BufferedInputStream(fis);
		
		//ѭ����ȡ10���ֽڣ��������ֵ��Ĳ���ʮ���ֽ� �ͽ�����;
		int b;
		for(int i = 0; i < 10 && (b = bis.read()) != -1; i++) {
			System.out.println((char)b);
		}
		
		//System.out.println((char)bis.read());
		
		/*byte[] arr = new byte[5];
		
		bis.read(arr);
		
		println(arr);
		
		byte[] arr2 = new byte[5];
		
		bis.read(arr2, 1, 3);
		
		println(arr2);*/
		
	}
	
	private static void println(byte[] arr) {
		for(int i = 0; i < arr.length; i++) {
			System.out.print((char)arr[i] + "\t");
		}
	}

}
